package com.xhh.nphm.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xhh.nphm.system.domain.MMailWorkFormLog;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
* @author Administrator
* @description 针对表【mMailWorkLog】的数据库操作Mapper
* @createDate 2022-06-08 17:19:16
* @Entity com.xhh.nphm.system.domain.MMailWorkFormLog
*/
public interface MMailWorkFormLogDao extends BaseMapper<MMailWorkFormLog> {

    /**
     * 工单id对应回访记录 列表数据
     * @param wfId
     * @return
     */
    @Select("select LogId as myPkVal,WfId,convert(varchar(19),LogTime,20) as opTime,dbo.frMailWFSpareStr(WfId) as SpareString,FlagString,OpDeptName,OpUserName,OpAction,OpDesc,WsOpen,WsDesc,CStepId,NStepId from mMailWorkLog where WfId=#{wfId} and IsDel=0  order by LogId")
//    @Select("select LogId as myPkVal,WfId,convert(varchar(19),LogTime,20) as opTime,SpareString,FlagString,OpDeptName,OpUserName,OpAction,OpDesc,WsOpen,WsDesc,CStepId,NStepId from mMailWorkLog where WfId=#{wfId} and IsDel=0  order by LogId")
    List<Map<String, Object>> logListJson(Integer wfId);

    /**
     * 信件工单 对应操作日志列表数据
     * @param wfId
     * @return
     */
    @Select("select LogId,WfId,convert(varchar(19),LogTime,20) as LogTime,OpDeptName,OpUserName,OpAction,OpDesc,WsOpen,WsDesc from mMailWorkLog where WfId=#{wfId} and IsDel=0 order by LogTime desc")
    List<MMailWorkFormLog> flowRollBackLog(Integer wfId);
}




